﻿namespace CanalService.Services;

/// <summary>
/// 
/// </summary>
public class CanalToRedisHostService : IHostedService
{

    private readonly CanalToRedisService _canalToRedisService;
    public CanalToRedisHostService(CanalToRedisService canalToRedisService)
    {
        _canalToRedisService = canalToRedisService;
    }

    public Task StartAsync(CancellationToken cancellationToken)
    {
        // 1、运行数据同步canal
        _canalToRedisService.OnStart();
        return Task.CompletedTask;
    }

    public Task StopAsync(CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

}
